package com.gitee.mars.tourserver.config;

import com.gitee.mars.tourserver.interceptor.AuthenticationInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author wangqinag
 * @version 1.0
 * @date 2020/12/29 11:03
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Resource
    private AuthenticationInterceptor tokenInterceptor;

    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(tokenInterceptor).addPathPatterns("/**");
    }
}
